package com.rock.securityresearch.util.http
// private[http]
case class HttpResponse(statusCode: Int, body:Array[Byte] = Array.empty, headers: Map[String, String] = Map.empty) {
    def bodyAsString(encoding: String = "utf-8"):String = String(body, encoding)

    def isOk: Boolean = statusCode == 200
    
    def isNoramlStatus: Boolean = statusCode >= 200 && statusCode <= 300
    
    def verifyOk: HttpResponse = if(isOk) then this else throw Exception("status not ok")
}
